const mongoose = require("mongoose");
const goodsSchema = new mongoose.Schema({
    name:String,
    price:String,
    imagePath:String,
    num:String,
    //状态值，库存默认为state=unsold
    //当商品上架时状态值为state=sell
    state:String,
    //关联门店
    shopsId:{
        // type:String,
        type:mongoose.Schema.Types.ObjectId,
        ref:"shopsModel"
    },
    //关联店铺
    storesId: {
        type: mongoose.Schema.Types.ObjectId,
        ref: "storesModel"
    }
},{ versionKey: false })
mongoose.model("goodsModel",goodsSchema,"goods")
